//
//  CLAboutViewController.m
//  chanlin
//
//  Created by Ryan on 15-2-23.
//  Copyright (c) 2015年 chanlin. All rights reserved.
//

#import "CLAboutViewController.h"
#import "BlockUI.h"
#import "UIView+Utils.h"
#import "CLWebVeiwController.h"
#import "CLPushAnimatedRight.h"

@interface CLAboutViewController ()

@property (nonatomic,strong)UIButton *backButton;

@property (nonatomic,strong)UIImageView *logo;

@end

@implementation CLAboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
    self.backButton=[UIButton buttonWithType:UIButtonTypeCustom];
    [self.backButton setImage:[UIImage imageNamed:@"tb_back.png"] forState:UIControlStateNormal];
    self.backButton.contentEdgeInsets=UIEdgeInsetsMake(7, 7, 7, 7);
    self.backButton.frame=CGRectMake(15.f, 20.f, 44.f, 44.f);
    __weak typeof(self) me=self;
    [self.backButton handleControlEvent:UIControlEventTouchUpInside withBlock:^(id sender) {
        [me.dispatchObj pop];
    }];
    [self.view addSubview:self.backButton];
    
    
    UILabel *title=[[UILabel alloc] init];
    title.font=[UIFont systemFontOfSize:20];
    title.frame=CGRectMake((GlobleWidth-100.f)/2.f, 30.f, 100.f, title.font.lineHeight);
    title.textColor=RGB(98, 101, 113);
    title.textAlignment=NSTextAlignmentCenter;
    title.text=@"关于";
    
    [self.view addSubview:title];
    
    CALayer *line=[CALayer layer];
    line.backgroundColor=title.textColor.CGColor;
    line.frame=CGRectMake(0, 64.f, GlobleWidth, 0.5);
    [self.view.layer addSublayer:line];
    
    self.logo=[[UIImageView alloc] init];
    self.logo.image=[UIImage imageNamed:@"icon120.png"];
    self.logo.frame=CGRectMake((GlobleWidth -60.f)/2.f, 100.f, 60.f, 60.f);
    [self.view addSubview:self.logo];
    
    UILabel *label1=[[UILabel alloc] init];
    label1.font=[UIFont systemFontOfSize:22.f];
    label1.textAlignment=NSTextAlignmentCenter;
    label1.frame=CGRectMake((GlobleWidth-120.f)/2.f, self.logo.bottom+15.f, 120, label1.font.lineHeight);
    label1.text=@"禅林";
    [self.view addSubview:label1];
    
    [self showToolbarWithType:0];
    
    UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    button.titleLabel.font=[UIFont systemFontOfSize:20.f];
    button.frame=CGRectMake((GlobleWidth-120.f)/2.f, GlobleHeight-165.f, 120, label1.font.lineHeight);
    [button setTitle:@"关于禅林软件" forState:UIControlStateNormal];
    [self.view addSubview:button];
    [button handleControlEvent:UIControlEventTouchUpInside withBlock:^(id sender) {
                CLWebVeiwController *web=[CLWebVeiwController new];
                web.itemId=@"http://www.chanlin.org/iosapp/index.html";
                [[CLPushAnimatedRight sharedInstance] pushController:web];
    }];
    
    UIButton *button2=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    button2.titleLabel.font=[UIFont systemFontOfSize:20.f];
    button2.frame=CGRectMake((GlobleWidth-120.f)/2.f, GlobleHeight-105.f, 120, label1.font.lineHeight);
    [button2 setTitle:@"开源组件许可" forState:UIControlStateNormal];
    [self.view addSubview:button2];
    [button2 handleControlEvent:UIControlEventTouchUpInside withBlock:^(id sender) {
        NSString *path=[[NSBundle mainBundle] pathForResource:@"per1" ofType:@"html"];
        CLWebVeiwController *web=[CLWebVeiwController new];
        web.isFile=YES;
        web.itemId=path;
        [[CLPushAnimatedRight sharedInstance] pushController:web];
    }];

    
    
}



@end
